def check(x):
    s = str(x)
    d = ['2','0','2','3']
    idx = 0
    cnt = 0
    for i in range(len(s)):
        if s[i] == d[idx]:
            idx+=1
            cnt+=1
        if cnt == 4:
            return True

    if cnt == 4:
        return True
    else:
        return False


res= 0

print(check(20193213))

for i in range(12345678,98765432+1):
    if check(i):
        res+=1

print(res)
    
